/**
 * <pre>
 * 紫光软件系统有限公司广电事业部
 * Copyright (C): 2011
 * 
 * 文件名称：
 * FormatBase64.java
 * 
 * 文件描述:
 * 日期处理类-获取指定日期。
 * 
 * Notes:
 * 
 * 
 * 修改历史(作者/日期/改动描述):
 * 杨飞宇/2011-10-26
 * </pre>
 */
package com.unis.iptv.common.utils;

import java.io.IOException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import sun.misc.BASE64Decoder;

/**
 * @author Administrator
 */
public class FormatBase64 {
	private static Log iptvCourse = LogFactory.getLog("iptvCourse");
	
	public static String getFromBASE64(String s) {
		if (s == null)
			return null;
		BASE64Decoder decoder = new BASE64Decoder();
		byte[] b;
		try {
			b = decoder.decodeBuffer(s);
			return new String(b, "GBK");
		} catch (IOException e) {
			return null;
		}
		
	}
	
	public static void main(String[] args) {
		iptvCourse
				.info(getFromBASE64("YToyMDp7czoxMDoicGFja2FnZV9pZCI7czoyOiI1OSI7czoxNDoib3NzX3BhY2thZ2VfaWQiO3M6NjoiNDUxMzA3IjtzOjQ6InR5cGUiO3M6MToiMCI7czo4OiJvcmRlcl9ubyI7czowOiIiO3M6MTA6ImNvbnRlbnRfaWQiO3M6NToiMTAwNjMiO3M6OToiZnJlZV9mbGFnIjtzOjE6IjAiO3M6MTk6InBhY2thZ2VfcmF0aW5nX2NvZGUiO3M6MToiMCI7czoxNDoiY29weV9wcm90ZWN0ZWQiO3M6MDoiIjtzOjEwOiJhY2Nlc3NfYml0IjtzOjE6IjAiO3M6OToiY2hpbGRfbnVtIjtpOjA7czo4OiJ2b2RfdHlwZSI7aTowO3M6ODoiZHJtX3R5cGUiO3M6MToiMCI7czo5OiJoZHR2X2ZsYWciO2k6MDtzOjExOiJnbG9iYWxfY29kZSI7czozMjoiMDEwMTAwMDEwMDAwMDAwMTAwMDAwMDAwMDAwMDAwMDciO3M6MTk6ImNvbnRlbnRfZ2xvYmFsX2NvZGUiO3M6MzI6IjAxMDEwMDAxMDAwMDAwMDIwM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